﻿using BCCommon;
using BCCommon.Enums;
using BCDto.Common.News.NewsContent;
using System;
using System.Collections.Generic;

namespace BCService.Common.News.NewsContentService
{
    /// <summary>
    /// 新闻内容服务接口
    /// </summary>
    public interface INewsContentService
    {
        /// <summary>
        /// 获取新闻内容列表总数
        /// </summary>
        /// <param name="contentCategoryId">内容分类Id</param>
        /// <param name="title">标题</param>
        /// <param name="keyWord">关键字</param>
        /// <param name="start">开始时间</param>
        /// <param name="end">结束时间</param>
        /// <param name="fromSim">来自后台查询</param>
        /// <returns></returns>
        int GetListCount(int? contentCategoryId, string title, string keyWord, DateTime? start, DateTime? end, bool fromSim);
        /// <summary>
        /// 获取新闻内容列表（分页）
        /// </summary>
        /// <param name="contentCategoryId">内容分类Id</param>
        /// <param name="title">标题</param>
        /// <param name="keyWord">关键字</param>
        /// <param name="start">开始时间</param>
        /// <param name="end">结束时间</param>
        /// <param name="fromSim">来自后台查询</param>
        /// <param name="ascending">排序</param>
        /// <param name="index">当前页码</param>
        /// <param name="size">每页数据条数</param>
        /// <returns></returns>
        PageableList<NewsContentDto> GetNewsPagingList(int? contentCategoryId,string title, string keyWord,DateTime? start,DateTime? end, bool fromSim, bool? ascending, int index, int size);
        /// <summary>
        /// 获取新闻内容视图列表
        /// </summary>
        /// <param name="title">标题</param>
        /// <param name="index">当前页码</param>
        /// <param name="size">每页数据条数</param>
        /// <param name="contentCategoryId">内容分类Id</param>
        /// <param name="keyWord">关键字</param>
        /// <param name="ascending">排序</param>
        /// <param name="fromSim">来自后台查询</param>
        /// <returns></returns>
        PageableList<NewsContentViewDto> GetViewList(int? contentCategoryId, string title, string keyWord, bool fromSim, bool? ascending, int index, int size);
        /// <summary>
        /// 获取新闻列表
        /// </summary>
        /// <param name="contentCategoryId">内容分类Id</param>
        /// <returns></returns>
        IEnumerable<NewsContentDto> GetNewsListByContentCategoryId(int contentCategoryId);
        /// <summary>
        /// 获取内容列表
        /// </summary>
        /// <param name="contentCategoryId">内容分类Id</param>
        /// <param name="startIndex">起始下标</param>
        /// <param name="amount">数量</param>
        /// <returns></returns>
        IEnumerable<NewsContentDto> GetContentListByIndexAndAmount(int contentCategoryId, int startIndex = 0, int amount = 0);
        /// <summary>
        /// 获取新闻内容
        /// </summary>
        /// <param name="newsContentId"></param>
        /// <returns></returns>
        IEnumerable<NewsContentDto> GetNewById(long newsContentId);
        /// <summary>
        /// 创建新闻内容
        /// </summary>
        /// <param name="dto">新闻内容信息</param>
        /// <param name="adminId">管理员Id</param>
        /// <param name="adminName">管理员姓名</param>
        /// <returns></returns>
        NewsContentDto Create(NewsContentRequestDto dto, long adminId, string adminName);
        /// <summary>
        /// 修改新闻内容
        /// </summary>
        /// <param name="newsContentId">新闻内容Id</param>
        /// <param name="dto">新闻内容信息</param>
        /// <param name="adminId">管理员Id</param>
        /// <returns></returns>
        NewsContentDto Update(long newsContentId, NewsContentRequestDto dto,long adminId);
        /// <summary>
        /// 删除新闻内容
        /// </summary>
        /// <param name="newsContentId">新闻内容Id</param>
        /// <returns></returns>
        IEnumerable<NewsContentDto> Delete(long newsContentId);
        /// <summary>
        /// 获取新闻内容
        /// </summary>
        /// <param name="newsContentId">新闻内容Id</param>
        /// <param name="fromSim">来自后台查询</param>
        /// <returns></returns>
        NewsContentDto GetNewsContentById(long newsContentId, bool fromSim);
        /// <summary>
        /// 获取新闻内容
        /// </summary>
        /// <param name="protocolType">协议类型</param>
        /// <returns></returns>
        NewsContentDto GetNewsContentByProtocol(string protocolType);
        /// <summary>
        /// 更新浏览次数
        /// </summary>
        /// <param name="newsContentId"></param>
        void UpdateViewsCount(long newsContentId);
        /// <summary>
        /// 更新点赞总数
        /// </summary>
        /// <param name="newsContentId">新闻Id</param>
        void UpdateLikeCount(long newsContentId);
        /// <summary>
        /// 更新转载次数
        /// </summary>
        /// <param name="newsContentId"></param>
        NewsContentDto UpdateReprintCount(long newsContentId);
        /// <summary>
        /// 根据关键字查询新闻列表
        /// </summary>
        /// <param name="contentCategoryId">分类ID</param>
        /// <param name="keyWord">关键字</param>
        /// <param name="pageIndex">当前页码</param>
        /// <param name="pageSize">每页数据条数</param>
        /// <returns></returns>
        PageableList<NewsContentDto> QueryNewsByKeyWord(int? contentCategoryId, string keyWord, int pageIndex = 1, int pageSize = 20);

        /// <summary>
        /// 查看上一篇或下一篇
        /// </summary>
        /// <param name="newsContentId"></param>
        /// <param name="isNext"></param>
        /// <returns></returns>
        NewsContentDto QueryPreviouOrNext(long newsContentId, bool isNext);

        /// <summary>
		/// 启用新闻内容
		/// </summary>
		/// <param name="newsContentId">新闻内容Id</param>
		bool Enabled(long newsContentId);
        /// <summary>
        /// 禁用新闻内容
        /// </summary>
        /// <param name="newsContentId">新闻内容Id</param>
        bool Disabled(long newsContentId);
    }
}
